package com.neuedu.ssm.service.impl;


import com.neuedu.ssm.mapper.UmsUserMapper;
import com.neuedu.ssm.po.UmsUser;
import com.neuedu.ssm.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 金山
 * 项目：springmvc-learn
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2025/3/1814:47
 */
@Service
public class UmsUserServiceImpl implements IUserService {

    @Autowired
    private UmsUserMapper userMapper;


    @Override
    public UmsUser getById(long id) {
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<UmsUser> list() {
        return userMapper.selectList();
    }

    @Override
    public boolean save(UmsUser umsUser) {
        return userMapper.insertSelective(umsUser)>0;
    }

    @Override
    public boolean update(UmsUser umsUser) {
        return   userMapper.updateByPrimaryKeySelective(umsUser)>0;

    }

    @Override
    public boolean delete(long id) {
        return userMapper.deleteByPrimaryKey(id) >0;
    }
}
